package com.heima.api;

import com.heima.model.article.dtos.ApArticleDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.common.dtos.ResponseResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "leadnews-article")
public interface IArticleClient {

    @PostMapping("/api/v1/article/save")
    ResponseResult saveArticle(@RequestBody ApArticleDto articleDto);

    @PostMapping("/api/v1/article/addAuthor")
    ResponseResult addAuthor(@RequestParam String name, @RequestParam Integer userId);

    @GetMapping("/api/v1/article/Article/{id}")
    ApArticle findArticleById(@PathVariable("id") Long id);
}
